<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'list.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
	<h4> list page. </h4>
	<br><br>
	
	<!-- 
		如果principal是一个对象，需要写property 如果是Username 或者字符串，不需要写
	 -->
	欢迎登录:<shiro:principal></shiro:principal>
	<br><br>
	
	
	有admin角色才会显示链接:
	<shiro:hasRole name="admin">
		<a href="admin.jsp">Admin Page(拥有admin角色才能访问)</a>
	</shiro:hasRole>
	<br><br>
	
	
	有user角色才会显示链接:
	<shiro:hasRole name="user" >
		<a href="user.jsp">User Page(拥有user角色才能访问)</a>
	</shiro:hasRole>
	<br><br>
    
    
    <a href="shiro/logout">退出登录</a>
    <br><br>
    
  </body>
</html>
